Initialize autopkgtest: compile and run upstream tests.
authorMo Zhou <lumin@debian.org>
Tue, 7 Jan 2020 02:31:08 +0000 (10:31 +0800)
committerMo Zhou <lumin@debian.org>
Tue, 7 Jan 2020 02:31:08 +0000 (10:31 +0800)
debian/tests/Makefile [new file with mode: 0644]
debian/tests/control [new file with mode: 0644]

diff --git a/debian/tests/Makefile b/debian/tests/Makefile
new file mode 100644 (file)
index 0000000..dc3ce80
--- /dev/null
@@ -0,0 +1,43 @@
+# libutf8proc Makefile
+
+UCFLAGS = $(shell dpkg-buildflags --get CPPFLAGS) \
+         $(shell dpkg-buildflags --get CFLAGS)
+
+all: check
+         
+test/tests.o: test/tests.c test/tests.h utf8proc.h
+       $(CC) $(UCFLAGS) -c -o test/tests.o test/tests.c
+
+test/normtest: test/normtest.c test/tests.o  utf8proc.h test/tests.h
+       $(CC) $(UCFLAGS) $(LDFLAGS) test/normtest.c test/tests.o -lutf8proc -o $@
+
+test/graphemetest: test/graphemetest.c test/tests.o  utf8proc.h test/tests.h
+       $(CC) $(UCFLAGS) $(LDFLAGS) test/graphemetest.c test/tests.o  -lutf8proc -o $@
+
+test/printproperty: test/printproperty.c test/tests.o  utf8proc.h test/tests.h
+       $(CC) $(UCFLAGS) $(LDFLAGS) test/printproperty.c test/tests.o  -lutf8proc -o $@
+
+test/charwidth: test/charwidth.c test/tests.o  utf8proc.h test/tests.h
+       $(CC) $(UCFLAGS) $(LDFLAGS) test/charwidth.c test/tests.o  -lutf8proc -o $@
+
+test/valid: test/valid.c test/tests.o  utf8proc.h test/tests.h
+       $(CC) $(UCFLAGS) $(LDFLAGS) test/valid.c test/tests.o  -lutf8proc -o $@
+
+test/iterate: test/iterate.c test/tests.o  utf8proc.h test/tests.h
+       $(CC) $(UCFLAGS) $(LDFLAGS) test/iterate.c test/tests.o  -lutf8proc -o $@
+
+test/case: test/case.c test/tests.o  utf8proc.h test/tests.h
+       $(CC) $(UCFLAGS) $(LDFLAGS) test/case.c test/tests.o  -lutf8proc -o $@
+
+test/custom: test/custom.c test/tests.o  utf8proc.h test/tests.h
+       $(CC) $(UCFLAGS) $(LDFLAGS) test/custom.c test/tests.o  -lutf8proc -o $@
+
+test/misc: test/misc.c test/tests.o  utf8proc.h test/tests.h
+       $(CC) $(UCFLAGS) $(LDFLAGS) -DUNICODE_VERSION='"'`$(PERL) -ne "/^UNICODE_VERSION=/ and print $$';" data/Makefile`'"' test/misc.c test/tests.o  -lutf8proc -o $@
+
+check: test/normtest test/graphemetest test/printproperty test/case test/custom test/charwidth test/misc test/valid test/iterate bench/util.c bench/util.h 
+       test/charwidth
+       test/valid
+       test/iterate
+       test/case
+       test/custom
diff --git a/debian/tests/control b/debian/tests/control
new file mode 100644 (file)
index 0000000..fb8a730
--- /dev/null
@@ -0,0 +1,3 @@
+Test-Command: make -f debian/tests/Makefile
+Depends: @, build-essential
+Restrictions: allow-stderr